package com.jt.utils;

import com.jt.exception.ServiceException;

/**
 * 此类用于参数校验
 * @author dc
 * @Classname Assert
 * @Date 2020/2/7 12:06
 */
public class Assert {
    public static void isValid(Boolean flag,String message){
        if(flag){
            throw new IllegalArgumentException(message);
        }
    }

    /**
     * 业务验证
     * @param statement
     * @param message
     */
    public static void isServiceValid(Boolean statement,String message){
        if(statement){
            throw new ServiceException(message);
        }
    }
}
